<template>
  <div>
    MyInput1:
    <MyInput v-model="value" />
    <span>相当于</span>
    MyInput2:
    <MyInput :value="value" @input="value = $event" />
    MyCheckbox:
    <MyCheckbox v-model="checked" />
    <!-- 相当于 -->
    <span>相当于</span>
    MyCheckbox2:
    <MyCheckbox :checked="checked" @change="checked = $event" />
  </div>
</template>

<script>
import MyInput from './components/MyInput.vue'
import MyCheckbox from './components/MyCheckbox.vue'
export default {
  name: 'vmodelDemo',
  data() {
    return {
      value: '',
      checked: false
    }
  },
  components: {
    MyInput,
    MyCheckbox
  }
}
</script>

<style lang="scss" scoped></style>
